Before conducting imputations, I excluded participants who said their sexual preferences were for “both” genders or the same gender (n = 76). I further excluded people who did not identify as black or coloured (n = 7) and people who did not report partners in the previous year (n = 170). Participants who had missing observations on those characteristics were left in the dataset. This left 1074 relationships reported by 647 participants. Of those relationships 400 started in the 12 months preceeding the survey. I imputed 50 datasets using the random forest method for continuous and nominal categorical variables and the “polr” method for our ordinal variables.


Figure 1. Age mixing pattern for randomly selected imputed dataset. Model 1 represents the linear mixed effects model with age as a linear term. Model 2 represents the GAMM with age as a smoothed term



Figure 2. 2A visualizes the spread of the residuals for the different models. Model 1 is the linear mixed effect model with age as a linear term, while Model 2 is a GAMM. 2b visualizes the pattern of residuals for the lme and gamm. In both models there appears to be constant variance



Figure 3. Extractions of model slopes, intercepts, intercept variance and residual variance for each imputed dataset



Figure 4. Fraction of relationships with different partner age groups, among those who are HIV positive



Figure 5. Age mixing pattern for those who are HIV positive



Figure 6. Distribution of bridge widths for each imputed dataset, by sex and HIV status



Figure 7. Model coefficients for relationship between HIV and bridge width. Results from negative binomial models with bridge width as the outcome. This is only among participants who reported more than 1 relationship in the previous year. Models adjust for race and age.



Overall, among men the expected count of bridge widths for those with HIV was 1.6 times higher than those who were HIV negative. Among women it was 2.67 times higher.


Figure 8. Expected bridge widths for different values of age (the spline variable), by gender. Each line represents a different imputed dataset. These curves represent typical values of race (black) and hiv status (negative)



Figure 9. Distribution of age differences in relationships, by gender and imputation dataset



Figure 10. Effect of participant HIV on age-differences in relationships, stratified by gender. Beta-coefficients are from generalized additive mixed effects models with a random intercept for participant. Models adjust for race and age.



Figure 11. Predicted age-differences for different ages of the participant, stratified by gender. The predictions are from a generalised additive mixed effects model with a random intercept for participant. Models adjust for race and hiv status.



Figure 12. Effect of HIV on “Always” using a condom in relationship, stratified by gender. Odds Ratios (ORs) are from generalized additive mixed models (logistic outcome) with a random intercept for the participant. Models are adjusted for age, agegaps (hypothetical mediator) and race.


cfhivfig <- cfmodcoef %>%
  filter(term == "hivPositive") %>%
  ggplot(aes(x = .imp, or)) +
   geom_hline(yintercept = 0, 
             color = "blue") +
  geom_point() +
  geom_pointrange(aes(ymax = orupr,
                      ymin = orlwr)) +
  facet_grid(sex ~ .) +
  xlab("Imputation") +
  ylab("OR") +
  theme

cfhivfig


Figure 13. Predicted probabilities of “Always” using a condom in a relationship for different ages of participant, stratified by gender. The predictions are from generalised additive mixed models (logistic outcome) with a random intercept for the participant. Models are adjusted for hiv status, age gaps(hypothetical mediator) and race.


cfagefig <- cfmodpredage %>%
  ggplot(aes(x = age, y = pred, group = .imp)) +
  geom_line() +
  facet_grid(. ~ sex) +
  xlab("Age") +
  ylab("Probability") +
  theme

cfagefig


Figure 14. Predicted probabilities of “Always” using a condom in a relationship for different agegaps, stratified by gender. The predictions are from generalised additive mixed models (logistic outcome) with a random intercept for the participant. Models are adjusted for hiv status, age, and race.


cfagediffig <- cfmodpredagedif %>%
  ggplot(aes(x = agedif, y = pred, group = .imp)) +
  geom_line() +
  facet_grid(. ~ sex) +
  xlab("Age") +
  ylab("Probability") +
  theme

cfagediffig


Figure 15. Effect of HIV on a relationship being concurrent with another relationship, stratified by gender. Odds Ratios (ORs) are from generalized additive mixed models (logistic outcome) with a random intercept for the participant. Models are adjusted for age, agegaps (hypothetical mediator) and race.


mcphivfig <- mcpmodcoef %>%
  filter(term == "hivPositive" &
           .imp != 34) %>%
  ggplot(aes(x = .imp, or)) +
   geom_hline(yintercept = 0, 
             color = "blue") +
  geom_point() +
  geom_pointrange(aes(ymax = orupr,
                      ymin = orlwr)) +
  facet_grid(sex ~ .) +
  xlab("Imputation") +
  ylab("OR") +
  theme

mcphivfig


Figure 16. Predicted probabilities of the relationship being concurrent for different ages, stratified by gender. The predictions are from generalised additive mixed models (logistic outcome) with a random intercept for the participant. Models are adjusted for hiv status, agegaps, and race.


mcpagefig <- mcpmodpredage %>%
  ggplot(aes(x = age, y = pred, group = .imp)) +
  geom_line() +
  facet_grid(. ~ sex) +
  xlab("Age") +
  ylab("Probability") +
  theme

mcpagefig


Figure 17. Predicted probabilities of the relationship being concurrent for different agegaps, stratified by gender. The predictions are from generalised additive mixed models (logistic outcome) with a random intercept for the participant. Models are adjusted for hiv status, age, and race.


mcpagediffig <- mcpmodpredagedif %>%
  ggplot(aes(x = agedif, y = pred, group = .imp)) +
  geom_line() +
  facet_grid(. ~ sex) +
  xlab("Age") +
  ylab("Probability") +
  theme

mcpagediffig